package com.example.composedemo

import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.lifecycle.ViewModel
import com.tencent.mmkv.MMKV

class MainViewModel : ViewModel() {
    var primaryColor: Color by mutableStateOf(Color(0xFF000000))
    var backgroundColor: Color by mutableStateOf(Color(0xFFFFFFFF))

    var h4TextSize: Float by mutableStateOf(20.0f)
    var h4TextStyle: TextStyle by mutableStateOf(TextStyle())

    var mediumShapeTopStart: Dp by mutableStateOf(0.dp)
    var mediumShapeTopEnd: Dp by mutableStateOf(0.dp)
    var mediumShapeBottomStart: Dp by mutableStateOf(0.dp)
    var mediumShapeBottomEnd: Dp by mutableStateOf(0.dp)

    val chosenThemeId = mutableStateOf(
        MMKV.defaultMMKV().getString(MMKVConstant.ChosenThemeCode, ThemeKinds.DEFAULT.name)
            ?: ThemeKinds.DEFAULT.name
    )
}